// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIHTMLMenu.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// A private interface.
    /// All methods throw NS_ERROR_DOM_SECURITY_ERR if the caller is not chrome.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("d3d068d8-e223-4228-ba39-4d6df21ba616")]
	public interface nsIHTMLMenu
	{
		
		/// <summary>
        /// Creates and dispatches a trusted event named "show".
        /// The event is not cancelable and does not bubble.
        /// See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SendShowEvent();
		
		/// <summary>
        /// Creates a native menu builder. The builder type is dependent on menu type.
        /// Currently, it returns nsXULContextMenuBuilder for context menus.
        /// Toolbar menus are not yet supported (the method returns null).
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIMenuBuilder CreateBuilder();
		
		/// <summary>
        /// Builds a menu by iterating over menu children.
        /// See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#building-menus-and-toolbars
        /// The caller can use a native builder by calling createBuilder() or provide
        /// a custom builder that implements the nsIMenuBuilder interface.
        /// A custom builder can be used for example to build native context menus
        /// that are not defined using <menupopup>.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Build([MarshalAs(UnmanagedType.Interface)] nsIMenuBuilder aBuilder);
	}
}
